package com.meme.editor.model.sprite2d;

import java.util.ListIterator;

import org.apache.log4j.Logger;

import com.meme.editor.EntityObject;
import com.meme.editor.PropertyValueModification;
import com.meme.editor.PropertyValueModificationList;

public class CompositedModuleGroup extends ModuleGroup 
{
	static Logger logger = Logger.getLogger (CompositedModuleGroup.class);

	public CompositedModuleGroup ()
	{
		this (null);
	}
	
	public CompositedModuleGroup (String name)
	{
		super (name);
	}
	
	public CompositedModule createNewCompositedModule ()
	{
		addNewChild ();
		
		return (CompositedModule) getChildByIndex (getChildrenCount () - 1);
	}
	
	@Override
	public String getDefaultName ()
	{
		return "Composited Modules";
	}
	
	@Override
	public boolean isValid ()
	{
		return true;
	}
	
	@Override
	protected boolean isValidChild (EntityObject entity)
	{
		return entity instanceof CompositedModule;
	}
	
	@Override
	public EntityObject insertNewChild (int insertPos)
	{
		CompositedModule module = new CompositedModule ();
		
		return insertChild (module, insertPos);
	}
	
	@Override
	protected void _handleModifyingPropertyValues (PropertyValueModificationList modications)
	{
		//...
//		ListIterator<PropertyValueModification> iter = modications.listIterator();
//		while ( iter.hasNext() )
//		{
//			PropertyValueModification mod = iter.next();
//			
//		}
				
			
		super._handleModifyingPropertyValues (modications);
	}
	
}
